]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Fix setting height in portrait orientation
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 4 Jul 2020 00:22:10 +0000 (02:22 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 6 Jul 2020 15:16:35 +0000 (15:16 +0000)
get_preferred_height() returns both the minimum and natural height,
not a single size. Math.min() doesn't handle that and returns NaN,
whoops.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2349

js/ui/keyboard.js

index 7df7ef16dabcb039526af50f82295f98f23a30d9..62df5922f754064d6d7834966a79a4a7d848df00 100644 (file)
@@ -1608,7 +1608,8 @@ class Keyboard extends St.BoxLayout {
              * we allow the OSK being smaller than 1/3rd of the monitor height
              * there.
              */
-            this.height = Math.min(maxHeight, this.get_preferred_height(monitor.width));
+            const [, natHeight] = this.get_preferred_height(monitor.width);
+            this.height = Math.min(maxHeight, natHeight);
         }
     }